package drukarnia.model;

import java.io.Serializable;
import java.sql.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name = "orders")
public class Orders implements Serializable{
	private int id_order;
	private User id_user;
	private String name_order;
	private Date date;
	private double cost;
	private String status;
	private PriceForMaterials typeOfMaterials;
	private String priority;
	private int copies;
	private String fileName;
	private String uwagi;
	
	@Id
	@GeneratedValue
	public int getId_order() {
		return id_order;
	}
	public void setId_order(int id_order) {
		this.id_order = id_order;
	}
	
	@OneToOne(targetEntity=User.class, cascade = CascadeType.ALL)
    @JoinColumn(name = "id_user", referencedColumnName="id_user" )
	public User getId_user() {
		return id_user;
	}
	public void setId_user(User id_user) {
		this.id_user = id_user;
	}
	public String getName_order() {
		return name_order;
	}
	public void setName_order(String name_order) {
		this.name_order = name_order;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public double getCost() {
		return cost;
	}
	public void setCost(double cost) {
		this.cost = cost;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	@OneToOne(targetEntity=PriceForMaterials.class, cascade = CascadeType.ALL)
    @JoinColumn(name = "typeOfMaterials", referencedColumnName="id_price" )
	public PriceForMaterials getTypeOfMaterials() {
		return typeOfMaterials;
	}
	public void setTypeOfMaterials(PriceForMaterials typeOfMaterials) {
		this.typeOfMaterials = typeOfMaterials;
	}
	public String getPriority() {
		return priority;
	}
	public void setPriority(String priority) {
		this.priority = priority;
	}
	public int getCopies() {
		return copies;
	}
	public void setCopies(int copies) {
		this.copies = copies;
	}
	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	public String getUwagi() {
		return uwagi;
	}
	public void setUwagi(String uwagi) {
		this.uwagi = uwagi;
	}

}
